package com.ruoyi.web.controller.sine;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.entity.SaleBill;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISaleBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import sine.req.SaleReq;
import sine.resp.SaleResp;

import java.util.List;

/**
 * FmtController
 *
 * @author HanQuinn
 * Date: 2023/5/6
 * Time: 14:13
 */
@RestController
@RequestMapping("/fmt")
public class FmtController {

    @Autowired
    private ISaleBillService saleBillService;


    @GetMapping("/get")
    @Anonymous
    public String query(SaleReq saleReq) {
        SaleBill saleBill = saleBillService.query();
        return JSONObject.toJSONString(saleBill);
    }

    @GetMapping("/togetherBill")
    @Anonymous
    public SaleResp togetherBill(@RequestParam String codes) {
        SaleReq saleReq = new SaleReq();
        saleReq.setBillCodes(codes);
        SaleResp resp = saleBillService.togetherBill(saleReq);
        return resp;
    }
}